package com.future.spring.context;

import com.future.spring.exception.BeansException;

/**
 * @author weber
 * @Description:
 * @Date 2025/7/31 14:08
 */
public interface BeanPostProcessor {

    /**
     * Invoked after new Bean
     *
     * @param bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    default Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    /**
     * Invoked after bean.init() called
     *
     * @param bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    default Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    /**
     * Invoked before bean.setXyz() called
     *
     * @param bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    default Object postProcessOnSetProperty(Object bean, String beanName) throws BeansException {
        return bean;
    }

}
